package web.hibernate;

import javax.persistence.*;
import java.util.Arrays;

/**
 * Created by IntelliJ IDEA.
 * User: user
 * Date: Jan 31, 2010
 * Time: 9:15:01 PM
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(catalog = "strutshibernatespring", name = "interdrugs")
public class InterdrugsEntity {
  private long interId;

  @Id
  @Column(name = "inter_id", nullable = false, length = 10)
  public long getInterId() {
    return interId;
  }

  public void setInterId(long interId) {
    this.interId = interId;
  }

  private char[] whatdrugName;

  @Basic
  @Column(name = "whatdrug_name", nullable = false, length = 100)
  public char[] getWhatdrugName() {
    return whatdrugName;
  }

  public void setWhatdrugName(char[] whatdrugName) {
    this.whatdrugName = whatdrugName;
  }

  private char[] withdrugName;

  @Basic
  @Column(name = "withdrug_name", nullable = false, length = 250)
  public char[] getWithdrugName() {
    return withdrugName;
  }

  public void setWithdrugName(char[] withdrugName) {
    this.withdrugName = withdrugName;
  }

  private char[] effect;

  @Basic
  @Column(name = "effect", nullable = false, length = 1000)
  public char[] getEffect() {
    return effect;
  }

  public void setEffect(char[] effect) {
    this.effect = effect;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    InterdrugsEntity that = (InterdrugsEntity) o;

    if (interId != that.interId) return false;
    if (!Arrays.equals(effect, that.effect)) return false;
    if (!Arrays.equals(whatdrugName, that.whatdrugName)) return false;
    if (!Arrays.equals(withdrugName, that.withdrugName)) return false;

    return true;
  }

  @Override
  public int hashCode() {
    int result = (int) (interId ^ (interId >>> 32));
    result = 31 * result + (whatdrugName != null ? Arrays.hashCode(whatdrugName) : 0);
    result = 31 * result + (withdrugName != null ? Arrays.hashCode(withdrugName) : 0);
    result = 31 * result + (effect != null ? Arrays.hashCode(effect) : 0);
    return result;
  }
}
